<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateShopGoodsUpdate extends Migrator
{
    /**
     * 商城 自动发货更新
     */
    public function up()
    {
        // 商品表
        $table = $this->table('shop_goods');
        $table->addColumn('image_wh', 'string', ['limit' => 255, 'null' => true, 'after' => 'image', 'default' => null, 'comment' => '主图宽高'])
            ->update();
    }

    /**
     * Migrate Down.
     */
    public function down()
    {
        // 商品表
        $table = $this->table('shop_goods');
        $table->removeColumn('image_wh')
            ->update();
    }
}
